package com.kgc.scd.service;

import com.kgc.scd.util.PageSupport;
import com.kgc.scd.vo.ShopGoodsVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created On : 2022/11/14 0014.
 * <p>
 * Author : shiguangchuan
 * <p>
 * Description: 历史足迹远程调用接口
 */
@FeignClient(value = "wyyxmall-sgc-server")
public interface ShopHistoryFeignService {

    /**
     * @author : shiguangchuan
     * @date   : 2022/11/14 0014
     * @param  : [goodsId, userId]
     * @return : void
     * @description : 调用远程sgc-server的足迹操作，更新足迹信息(被查看商品详情操作调用)
     */
    @PostMapping("/sgcServer/updateHistory")
    void feignInvokeUpdateHistory(@RequestParam("goodsId") String goodsId,
                                  @RequestParam("userId") String userId);
    
    /**
     * @author : shiguangchuan
     * @date   : 2022/11/15 0015
     * @param  : [pageNo, pageSize, userId]
     * @return : com.kgc.scd.util.PageSupport<com.kgc.scd.vo.ShopGoodsVO>
     * @description : 查询足迹页面的信息，初视商品信息 
     */
    @GetMapping("/sgcServer/selectHistoryList")
    PageSupport<ShopGoodsVO> feignInvokeSelectHistory(@RequestParam("pageNo") Integer pageNo,
                                                      @RequestParam("pageSize") Integer pageSize,
                                                      @RequestParam("userId") String userId);

    /**
     * @author : shiguangchuan
     * @date   : 2022/11/15 0015
     * @param  : [ids]
     * @return : boolean
     * @description : 删除足迹信息，可进行批量删除
     */
    @PostMapping("/sgcServer/deleteHistory")
    boolean feignInvokeDeleteHistoryById(@RequestParam("ids") List<String> ids);
    
    /**
     * @author : shiguangchuan
     * @date   : 2022/11/15 0015
     * @param  : [userId]
     * @return : boolean
     * @description : 用户全部删除足迹信息 
     */
    @PostMapping("/sgcServer/deleteAllHistory")
    boolean feignInvokeDeleteHistoryByUserId(@RequestParam("userId") String userId);
}
